@extends('admin.master')
<script src="/js/admin/index.js"></script>
@section('title', '账号管理')
	
@section('firstItem')
@parent
				<span>账号管理</span>
				<input class="a_indexbg" type="hidden" value="index" />
				
@stop
@section('searchList')
@parent
				<div class="seizeBox"></div>
@stop
@section('dataTables')
@parent
			<table class="accountManageTable dataTables" cellspacing="0" cellpadding="0">
				<thead>
					<tr>
						<td>序号</td>
						<td>登录账号</td>
						<td>姓名</td>
						<td>电话</td>
						<td>账号属性</td>
						<td>账号管理</td>
					</tr>
				</thead>
				<tbody>
					@if($user->hasAccess(['superadmin']))
						@for($i=0, $adminInfoCount=count($admin_infos); $i<$adminInfoCount; $i++)
					<tr >
						<td>{{ $i+1 }}</td>
						<td class="accountNumCell">{{ $admin_infos[$i]->user->username }}</td>
						<td class="accountUserCell">{{ $admin_infos[$i]->name }}</td>
						<td class="accountPhoneCell">{{ $admin_infos[$i]->phone }}</td>
						<td class="accountPropertiesCell">{{ $admin_infos[$i]->user->roles->first()->name }}</td>
						<td>
							<p class="cellBtn">
								<span class="writeBtn indexWriteBtn">编辑</span>
								<input type="hidden" value="{{ $admin_infos[$i]->user_id }}" />
								<span class="deleteBtn indexDeleteBtn">删除</span>
								<input type="hidden" value="{{ $admin_infos[$i]->user_id }}" />
							</p>
						</td>
					</tr>
						@endfor
					@else
					<tr >
						<td>{{ 1 }}</td>
						<td class="accountNumCell">{{ $admin_infos->username }}</td>
						<td class="accountUserCell">{{ $admin_infos->adminInfo->name }}</td>
						<td class="accountPhoneCell">{{ $admin_infos->adminInfo->phone }}</td>
						<td class="accountPropertiesCell">{{ $admin_infos->roles->first()->name }}</td>
						<td>
							<p class="cellBtn">
								<span class="writeBtn indexWriteBtn">编辑</span>
								<input type="hidden" value="{{ $admin_infos->id }}" />
								<span class="deleteBtn indexDeleteBtn">删除</span>
								<input type="hidden" value="{{ $admin_infos->id }}" />
							</p>
						</td>
					</tr>
					@endif
				</tbody>
			</table>
@stop
@section('add_div')
	@parent
	<div class="addInfosBtn addInstallInfos">添加账号</div>	
@stop
@section('page_num')
<ul class="pagination pagination-lg"> 
	@if($user->hasAccess(['superadmin']))
	{!! $admin_infos->render() !!}
	@endif
</ul>			
@stop
@section('infor_promit')
@parent
	<!-- 添加账号信息弹框 -->
	<div class="accountManage accountManageBox" >
		<div><span>登录账号</span><input class="accountAddNum" type="text" placeholder="账号不能大于12位字符" /><label class="required">*</label></div>
		<div><span>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</span><input class="magagerAddName" type="text" value="" placeholder="请填姓名" /><label class="required">*</label></div>
		<div><span>手机号码</span><input class="managerAddPhone" type="text" value="" placeholder="请填手机号码" /><label class="required">*</label></div>
		<div class="div_relative">
			<span>账号属性</span>
			<input class="accountProperty accountAddProperty" />
			<label class="required_left" style="margin-left:205px;">*</label>
			<div class="accountDropBox accountAddDropBox">
				<a>普通管理员</a>
				<a>财务</a>
				<a>员工</a>
			</div>
		</div>
		<div style="margin-top: 20px;"><span>输入密码</span><input class="managerAPassword" type="password" value="" placeholder="密码不少于6位字符" /><label class="required">*</label></div>
		<div><span>确认密码</span><input class="managerANPassword" type="password" value="" placeholder="密码不少于6位字符" /><label class="required">*</label></div>
		<div><label class="labelBox" id="indexALabelBox"></label></div>
		<div class="btnBox btnAddBox" >
			<a class="indexINoBtn">取消</a>
			<a class="okBtn indexAddOkBtn">确定</a>
		</div>
	</div>
	<!-- 编辑账号信息弹框 -->
	<div class="accountManage accountEditManage" >
		<div><span>登录账号</span><span class="accountENum"></span></div>
		<div><span>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</span><input class="magagerEName" type="text" value="" placeholder="请填姓名" /><label class="required">*</label></div>
		<div><span>手机号码</span><input class="managerEPhone" type="text" value="" placeholder="请填手机号码" /><label class="required">*</label></div>
		<div class="div_relative">
			<span>账号属性</span>
			<input class="accountProperty accountEProperty" type="text" value="" placeholder="请填整数"/>
			<div class="accountDropBox accountEditDropBox">
				<a>普通管理员</a>
				<input type="hidden" value="2" />
				<a>财务</a>
				<input type="hidden" value="3" />
				<a>员工</a>
				<input type="hidden" value="4" />
			</div>
		</div>
		<div><label class="labelBox" id="indexEditLabelBox"></label></div>
		<div class="btnBox" >
			<a class="indexENoBtn">取消</a>
			<a class="okBtn indexOkBtn">确定</a>
		</div>
	</div>
	<!-- 删除账号 -->
	<div class="deleteABox">
		<div class="accountList">
			<p><span>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:</span><span style="font-weight: bold;" class="deletLName">64613213456</span></p>
			<p><span>手机号码:</span><span style="font-weight: bold;" class="deletLPhone">12</span></p>
		</div>
		<div class="accountList">
			<p><span>登录账号:</span><span style="font-weight: bold;" class="deleteANum">45645435</span></p>
			<p><span>账号属性:</span><span style="font-weight: bold;" class="deleteLProperty">普通管理员</span></p>
		</div>
		<div class="hintText">确定删除该账号？</div>
		<label class="labelBox" id="indexDLabelBox"></label>
		<div class="btnBox" style="width: 350px; margin: 0 auto;">
			<a class="indexDNoBtn">取消</a>
			<a class="okBtn indexDOkBtn">确定</a>
		</div>
	</div>
@stop
